//
//  UIButton+btn.m
//  OC--新浪微博
//
//  Created by Apple on 15/11/9.
//  Copyright © 2015年 Apple. All rights reserved.
//

#import "UIButton+btn.h"

@implementation UIButton (btn)
+ (UIButton *)setBackImageName:(NSString *)BackimageName  ImageName:(NSString *)ImageName {
    UIButton *btn = [self new];
    [btn  setImage:[UIImage imageNamed:ImageName] forState:UIControlStateNormal];
    [btn  setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@_highlighted",ImageName]] forState:UIControlStateHighlighted];
    [btn  setBackgroundImage:[UIImage imageNamed:BackimageName] forState:UIControlStateNormal];
    [btn  setBackgroundImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@_highlighted",BackimageName]] forState:UIControlStateHighlighted];
    [btn sizeToFit];
    return  btn;
}
+ (UIButton *)setBackImageName:(NSString *)BackimageName title:(NSString *)title color:(UIColor *)color {
    UIButton *btn = [self new];
    [btn setTitle:title forState:UIControlStateNormal];
    [btn setTitleColor:color forState:UIControlStateNormal];
    [btn  setBackgroundImage:[UIImage imageNamed:BackimageName] forState:UIControlStateNormal];
    [btn sizeToFit];
    return  btn;
}
+ (UIButton *)setimgName:(NSString *)imgName title:(NSString *)title color:(UIColor *)color {
    UIButton *btn = [self new];
    [btn setTitle:title forState:UIControlStateNormal];
    [btn setTitleColor:color forState:UIControlStateNormal];
    [btn  setImage:[UIImage imageNamed:imgName] forState:UIControlStateNormal];
    [btn sizeToFit];
    return  btn;
}

@end
